Skip to content

[cpu] support TF single-stepping to make gdb work#1574

Open
lqs wants to merge 1 commit into
copy:masterfrom
lqs:flag-trap
Open

[cpu] support TF single-stepping to make gdb work#1574
lqs wants to merge 1 commit into
copy:masterfrom
lqs:flag-trap

Conversation

@lqs
Copy link
Copy Markdown

@lqs lqs commented Jun 2, 2026

The trap flag (FLAG_TRAP) was previously logged as unsupported and cleared on update_eflags, so any guest debugger relying on single-stepping didn't work.

This adds proper TF handling: when TF is set, cycle_internal interprets one instruction at a time and raises #DB afterwards. DR6.BS is set so the guest can distinguish a single-step trap from a hardware breakpoint.

With this, gdb breakpoints and single-stepping (stepi/continue over breakpoints) now work inside the guest.

Fixes #278.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SIGSEGV when run a program in gdb

1 participant